/***************************************************************************
 创建者: 华磊
 开始时间: 2018.8.14
 copyright: (C) 华友高科
 修改说明: (每次有修改就添加一条，带有 修改人，修改时间，修改描述)
 example (1) hualei 2017.5.8 类的具体实现代码编写

 ***************************************************************************/

#include "hmigsoapqt.h"
#include "messagelog.h"
#include<QString>
#include<QDebug>
#include "powermanager.h"

extern PowerManager *p_powerManger;

//***********************************************************************
/**
 * @brief g_hmiGaoapQt      获取实例化指针:供外部的gsoap接口使用
 */
HmiGsoapQt *g_hmiGaoapQt = NULL;

/**
 * @brief threadRun     线程:供gsoap服务器接收服务使用(更新用)
 */
void* run_receiveThread(void *arg)
{
    std::cout<<"start the thread of Gsoap RecvLoop run_receiveThread"<<std::endl;
    g_hmiGaoapQt->gsoapServerObject->loopRecvServer_hualei();
}


//*******HmiGsoap*********************************************************
HmiGsoapQt::HmiGsoapQt()
{
    versionInfo.componentName="HmiGsoapQt";
    versionInfo.componentVersion="V1.0";
    versionInfo.publishDate="2018.10.27";
    p_powerManger->registerComponentVersion(versionInfo);

    //提供组件类给外部使用
    g_hmiGaoapQt = this;//获取指针

//    //初始化看门狗
//    serverWatchDog = EM_FOOD_END;
//    serverWatchDogSum = 0;
//    timerDog = new QTimer();
//    connect(timerDog,SIGNAL(timeout()),this,SLOT(dogTimeWork()));

    if(initialGsoapServer())
    {
//        timerDog->start(400);//400ms看门狗
    }
}

HmiGsoapQt::~HmiGsoapQt()
{
    //退出清空
    gsoapServerObject->quitServer();      //清空服务器实例(更新用)5050
//    pthread_cancel(tidUpdate);            //清除线程
//    pthread_join(tidUpdate, NULL );
}

int HmiGsoapQt::readVersion(std::vector <ComponentVersion> &componentVersionList)
{
    componentVersionList.push_back(versionInfo);
    return 1;
}

bool HmiGsoapQt::initialGsoapServer()
{
    //初始化gsoap服务器对象(更新用)
    gsoapServerObject = new GsoapServer;
    if(!gsoapServerObject->startServer(HMI_GSOAP_PORT))
    {
        std::cout << "can not creat the gsoapServer" <<std::endl;
        return false;
    }

    //启动线程:循环接收客户端连接(更新用)
    int createResult = pthread_create(&tidUpdate,NULL,run_receiveThread,NULL);
    if(createResult!=0)
    {
        std::cout << "can not creat the thread" <<std::endl;
        return false;
    }

    return true;
}

//void HmiGsoapQt::dogTimeWork()
//{
//    if(serverWatchDog == EM_FOOD_NONE)
//    {
//        serverWatchDogSum++;
//        std::cout << "EM_FOOD_NONE " <<serverWatchDogSum <<std::endl;

//        if(serverWatchDogSum >= 5)
//        {
//            //执行? 停止指令
//            std::cout<<"dog hungry !*************"<<std::endl;

//            //是一直执行重复 停止指令 ?还是 复位狗:只执行一次? 5050
//            UserInfo userInfo;
//            userInfo.account=ENUM_POWER_ADMIN;
//            int returnFlag;
//            programReset( NULL, userInfo , returnFlag );

//            //复位
//            if(currentControllerIP.compare("") != 0)
//            {
//                serverWatchDog = EM_FOOD_END;
//                currentControllerIP = "";
//            }
//        }

//    }
//    else if(serverWatchDog == EM_FOOD_FEED)
//    {
//        std::cout << "EM_FOOD_FEED " <<serverWatchDogSum <<std::endl;

//        serverWatchDog = EM_FOOD_NONE;      //正常

//        serverWatchDogSum = 0;              //超时统计复位
//    }
//    else
//    {
//        //EM_FOOD_END:服务器初始化状态,没有接入;
//        //或是非监测状态(非手动操作状态,或操作已释放)
//    }
//}

//void HmiGsoapQt::currentControllerToDog(std::string currentIP)
//{
//    if(currentControllerIP.compare("") == 0)
//    {
//        currentControllerIP = currentIP;
//        serverWatchDog = EM_FOOD_FEED;      //开始喂狗
//    }
//    else if(currentControllerIP.compare(currentIP) == 0)
//    {
//        serverWatchDog = EM_FOOD_FEED;      //喂狗
//    }
//}

//void HmiGsoapQt::clearControllerToDog(std::string currentIP)
//{
//    if(currentControllerIP.compare(currentIP) == 0)
//    {
//        serverWatchDog = EM_FOOD_END;       //中止喂狗

//        currentControllerIP = "";           //复位
//    }
//}



//*******GSOAP接口函数部分******************************************************
//测试用
int testFoundation(soap *,struct UserInfo userInfo,struct UserInfo &returnnfo)
{
    std::cout <<userInfo.account<<std::endl;
    std::cout <<userInfo.ip<<std::endl;
    std::cout <<userInfo.operationSystem<<std::endl;
    std::cout <<userInfo.password<<std::endl;

    returnnfo.account = 99999;
    returnnfo.ip ="return ip is *******";

    if(userInfo.account == 0)
    {
        std::string testS;
        testS = "AB";//2
        testS = testS + testS;//4
        testS = testS + testS;//8
        testS = testS + testS;//16
        testS = testS + testS;//32
        testS = testS + testS;//64
        testS = testS + testS;//128
        testS = testS + testS;//256
        testS = testS + testS;//512
        testS = testS + testS;//1024 1m
        testS = testS + testS;//2m
        testS = testS + testS;//4m
        testS = testS + testS;//8m
        returnnfo.operationSystem = testS;
        returnnfo.password = "123456";
    }
    else
    {
        returnnfo.operationSystem = "ok";
        returnnfo.password = "123456*******";
    }

    return 0;//必须有
}

int setUToolActive(soap *, struct UserInfo userInfo,int number,int &returnFlag)
{
    qDebug()<<"setUToolActive:"<<number;
    returnFlag = 1;

    p_powerManger-> setUToolActive( userInfo , number, returnFlag );
    return 0;//必须有
}

int setUFrameActive(soap *, struct UserInfo userInfo,int number,int &returnFlag)
{
    qDebug()<<"setUFrameActive:"<<number;
    returnFlag = 1;

    p_powerManger-> setUFrameActive( userInfo , number, returnFlag );
    return 0;//必须有
}

int getUToolActive(soap *, struct UserInfo userInfo,int &returnUToolNum)
{
    p_powerManger-> getUToolActive( userInfo ,  returnUToolNum );
    return 0;//必须有
}

int getUFrameActive(soap *, struct UserInfo userInfo,int &returnUFrameNum)
{
    p_powerManger-> getUFrameActive( userInfo , returnUFrameNum );
    return 0;//必须有
}

int updateControllerInfoLevel1(soap *, struct UserInfo userInfo,int currentRobotId,struct UpdateDataLv1 &updateDataLv1)
{

#if 1

    p_powerManger->updateControllerInfoLevel1( userInfo, currentRobotId, updateDataLv1 ) ;


#else
    //qDebug()<<QString::fromStdString(userInfo.password);

    //updateDataLv1.globalSerialStatus = 28;

    updateDataLv1.globalRegStatus = 28;

    updateDataLv1.globalLockMachTime = "20161212";

    //updateDataLv1.globalMotorType = 28;

    //updateDataLv1.globalSerialValue = 28;

    updateDataLv1.serialNumber = "testtest20161212";

    updateDataLv1.mainProgramVersion = 28;

    struct ComponentVersion tmp;
    tmp.componentName = "com";
    tmp.componentVersion = "v1.0";
    tmp.publishDate = "data";
    updateDataLv1.componentVersionList.push_back(tmp);
    updateDataLv1.componentVersionList.push_back(tmp);

    //struct UserInfo tmp1;
    //tmp1.password = "ttttt";
    //updateDataLv1.multiUserInfo.push_back(tmp1);

    //轴数
    updateDataLv1.robotAxisCount = 4;
    //外部轴数
    updateDataLv1.extAxisCount = 2;
    //软限位
    struct AxisLimit tmp2;
    tmp2.positive = -100;
    tmp2.negative = 100;
    updateDataLv1.axisLimit.push_back(tmp2);
    updateDataLv1.axisLimit.push_back(tmp2);
    updateDataLv1.axisLimit.push_back(tmp2);
    updateDataLv1.axisLimit.push_back(tmp2);
    //updateDataLv1.axisLimit.push_back(tmp2);
    //updateDataLv1.axisLimit.push_back(tmp2);
    //轴单位
    updateDataLv1.axisUnit.push_back(1);
    updateDataLv1.axisUnit.push_back(1);
    updateDataLv1.axisUnit.push_back(1);
    updateDataLv1.axisUnit.push_back(1);
    //updateDataLv1.axisUnit.push_back(0);
    //updateDataLv1.axisUnit.push_back(0);

    updateDataLv1.controllerIp = "192.168";

    updateDataLv1.controllerMac = "ff:99";

    //机器人信息

    struct CommRobotInfo tmpR2;
    tmpR2.robotId = 1002;
    tmpR2.robotName = "kuka";
    struct CommRobotInfo tmpR3;
    tmpR3.robotId = 1003;
    tmpR3.robotName = "fanuc";
    updateDataLv1.robotInfoList.push_back(tmpR2);
    updateDataLv1.robotInfoList.push_back(tmpR3);
#endif

    return 0;//必须有
}

int updateControllerInfoLevel2(soap *, struct UserInfo userInfo,struct UpdateDataLv2 &updateDataLv2)
{
#if 1

    p_powerManger->updateControllerInfoLevel2(userInfo, updateDataLv2 );

#else
    //消息
    struct Message tmp;
    tmp.MessageLevel = 2;
    tmp.componentClassName = "msg1";
    tmp.MessageInformation = "msg";
    tmp.time = "2016";
    struct Message tmpM;
    tmpM.MessageLevel = 9;
    tmpM.componentClassName = "msg1";
    tmpM.MessageInformation = "msg";
    tmpM.time = "2016";
    struct Message tmpM2;
    tmpM2.MessageLevel = 1;
    tmpM2.componentClassName = "msg1";
    tmpM2.MessageInformation = "msg";
    tmpM2.time = "2015";
    updateDataLv2.messageVector.push_back(tmp);//未全部
    updateDataLv2.messageVector.push_back(tmpM);
    updateDataLv2.messageVector.push_back(tmpM2);


    /*top view*/
    //速度
    updateDataLv2.globalManSpeed = 50;
    updateDataLv2.globalProSpeed = 50;
    //手动模式
    updateDataLv2.globalHandRunStatus = 1;
    //手动坐标系
    updateDataLv2.globalCoordinate = 1;
    //运行模式
    updateDataLv2.globalHandState = 1;
    //坐标系
    updateDataLv2.globalDefaultUserNum = 1;
    updateDataLv2.globalDefaultToolNum = 1;
    //伺服状态
    updateDataLv2.globalServoState = 0;



    updateDataLv2.globalSafePointFlag = 1;

    updateDataLv2.globalHandSwitch = 1;

    updateDataLv2.globalZeroCtrlFlag = 1;

    updateDataLv2.globalCurrentState = 1;

    updateDataLv2.globalZeroStatus = 1;

    updateDataLv2.emergencyStatus = 1;

    updateDataLv2.globalPosType = 1;

    updateDataLv2.startType = 1;

    srand(time(NULL));          //测试
    int a = rand()%100+1;
    if(a>50){a=1;}
    else{a=0;}
    int b = rand()%100+1;
    int c = rand()%100+1;



//    if(a == 0)                   //关节
//    {
        updateDataLv2.currentPositionJoint.jointFlag = JOINT_FLAG_JOINT;
        updateDataLv2.currentPositionJoint.positionValue.push_back(b);
        updateDataLv2.currentPositionJoint.positionValue.push_back(c);
        updateDataLv2.currentPositionJoint.positionValue.push_back(b);
        updateDataLv2.currentPositionJoint.positionValue.push_back(c);
        //updateDataLv2.currentPosition.positionValue.push_back(b);
//    }
//    else                        //笛卡尔
    {
        updateDataLv2.currentPositionWorld.jointFlag = JOINT_FLAG_CARTESIAN;
        updateDataLv2.currentPositionWorld.positionValue.push_back(b);
        updateDataLv2.currentPositionWorld.positionValue.push_back(c);
        updateDataLv2.currentPositionWorld.positionValue.push_back(b);
        updateDataLv2.currentPositionWorld.positionValue.push_back(c);
        updateDataLv2.currentPositionWorld.positionValue.push_back(b);
        updateDataLv2.currentPositionWorld.positionValue.push_back(c);
    }

    updateDataLv2.ioIn.push_back(a);
    updateDataLv2.ioIn.push_back(a);
    updateDataLv2.ioIn.push_back(a);
    updateDataLv2.ioIn.push_back(a);
    updateDataLv2.ioIn.push_back(a);
    updateDataLv2.ioIn.push_back(a);
    updateDataLv2.ioIn.push_back(a);
    updateDataLv2.ioIn.push_back(a);
    updateDataLv2.ioIn.push_back(a);
    updateDataLv2.ioIn.push_back(a);
    updateDataLv2.ioIn.push_back(a);
    updateDataLv2.ioIn.push_back(a);
    updateDataLv2.ioIn.push_back(a);
    updateDataLv2.ioIn.push_back(a);
    updateDataLv2.ioIn.push_back(a);
    updateDataLv2.ioIn.push_back(a);
    updateDataLv2.ioIn.push_back(a);
    updateDataLv2.ioIn.push_back(a);
    updateDataLv2.ioIn.push_back(a);
    updateDataLv2.ioIn.push_back(a);

    updateDataLv2.ioOut.push_back(0);
    updateDataLv2.ioOut.push_back(0);
    updateDataLv2.ioOut.push_back(1);
    updateDataLv2.ioOut.push_back(0);

    updateDataLv2.ai.push_back(0.001);
    updateDataLv2.ai.push_back(0.001);
    updateDataLv2.ai.push_back(0.003);
    updateDataLv2.ai.push_back(0.001);

    updateDataLv2.ao.push_back(0.001);
    updateDataLv2.ao.push_back(0.001);
    updateDataLv2.ao.push_back(0.004);
    updateDataLv2.ao.push_back(0.001);

    updateDataLv2.si.push_back(1);
    updateDataLv2.si.push_back(0);
    updateDataLv2.si.push_back(0);
    updateDataLv2.si.push_back(1);

    updateDataLv2.so.push_back(0);
    updateDataLv2.so.push_back(1);
    updateDataLv2.so.push_back(0);
    updateDataLv2.so.push_back(0);


    updateDataLv2.localRegister.push_back(0.001);
    updateDataLv2.localRegister.push_back(0.001);
    updateDataLv2.localRegister.push_back(0.003);
    updateDataLv2.localRegister.push_back(0.001);

    updateDataLv2.globalRegister.push_back(0.001);
    updateDataLv2.globalRegister.push_back(0.001);
    updateDataLv2.globalRegister.push_back(0.004);
    updateDataLv2.globalRegister.push_back(0.001);

    struct PointPro p;
    p.jointFlag = JOINT_FLAG_JOINT;
    p.pointNum = 0;
    //p.direction = 1;
    p.configString = "test msg";
    p.configInt.push_back(4);
    p.configInt.push_back(9);
    p.positionValue.push_back(10);
    p.positionValue.push_back(11);
    p.positionValue.push_back(12);
    p.extPositionValue.push_back(9);
    struct PointPro p2;
    p2.jointFlag = JOINT_FLAG_CARTESIAN;
    p2.pointNum = 1;
    //p2.direction = 0;
    p2.configString = "test msg t+";
    p2.configInt.push_back(9);
    p2.configInt.push_back(4);
    p2.positionValue.push_back(21);
    p2.positionValue.push_back(22);
    p2.positionValue.push_back(23);
    p2.extPositionValue.push_back(19);
    updateDataLv2.pointRegister.push_back(p);
    updateDataLv2.pointRegister.push_back(p2);
    updateDataLv2.pointRegister.push_back(p);
    updateDataLv2.pointRegister.push_back(p2);

    updateDataLv2.timerRegister.push_back(9);
    updateDataLv2.timerRegister.push_back(18);
    updateDataLv2.timerRegister.push_back(7);
    updateDataLv2.timerRegister.push_back(4);

    struct  PlRegStruct pl;
    pl.row = 0;
    pl.col = 1;
    pl.layer = 2;
    updateDataLv2.plRegister.push_back(pl);
    updateDataLv2.plRegister.push_back(pl);
    updateDataLv2.plRegister.push_back(pl);
    updateDataLv2.plRegister.push_back(pl);
    updateDataLv2.plRegister.push_back(pl);

    QDateTime time = QDateTime::currentDateTime();//获取系统现在的时间
    QString str = time.toString("yyyy-MM-dd hh:mm:ss"); //设置显示格式
    updateDataLv2.currentTime = str.toStdString();

    updateDataLv2.axisTorque.push_back(0.011);
    updateDataLv2.axisTorque.push_back(0.001);
    updateDataLv2.axisTorque.push_back(0.404);
    updateDataLv2.axisTorque.push_back(0.001);

    updateDataLv2.axisSpeed.push_back(0.601);
    updateDataLv2.axisSpeed.push_back(0.001);
    updateDataLv2.axisSpeed.push_back(0.044);
    updateDataLv2.axisSpeed.push_back(0.001);

    updateDataLv2.axisPosition.push_back(51);
    updateDataLv2.axisPosition.push_back(301);
    updateDataLv2.axisPosition.push_back(7);
    updateDataLv2.axisPosition.push_back(8);

    updateDataLv2.axisFollowOffset.push_back(21);
    updateDataLv2.axisFollowOffset.push_back(78);
    updateDataLv2.axisFollowOffset.push_back(3);
    updateDataLv2.axisFollowOffset.push_back(4);

    updateDataLv2.currentRunFile.runingFileName.push_back("test1");
    updateDataLv2.currentRunFile.runingFileName.push_back("test2");
    updateDataLv2.currentRunFile.runingFileName.push_back("test3");

    updateDataLv2.currentRunFile.runningFileLine.push_back(2);
    updateDataLv2.currentRunFile.runningFileLine.push_back(5);

    updateDataLv2.currentRunFile.relatedFileName.push_back("t1");
    updateDataLv2.currentRunFile.relatedFileName.push_back("t2");

    //updateDataLv2.defaultUserFile = "program default";

#endif


    return 0;//必须有
}

int updateControllerInfoLevel2_agv(soap *, struct UserInfo userInfo,
                                   struct VehicleBasicInfo &vehicleInfo)
{
    p_powerManger->updateControllerInfoLevel2_agv(userInfo, vehicleInfo );

    return 0;//必须有
}

int updateControllerInfoLevel2_positions(soap *,struct UserInfo userInfo,
                                         struct VehiclePositionsInfo &positionsInfo)
{
    p_powerManger->updateControllerInfoLevel2_positions(userInfo, positionsInfo );

    return 0;//必须有
}


int updateControllerInfoLevel3(soap *, struct UserInfo userInfo,struct UpdateDataLv3 &updateDataLv3)
{
    p_powerManger->updateControllerInfoLevel3(userInfo,updateDataLv3);
    return 0;//必须有
}

int updateControllerMessage(soap *, struct UserInfo userInfo,std::vector<struct Message> &messageVector)
{
    p_powerManger->updateControllerMessage(   userInfo, messageVector );
    return 0;//必须有
}

int initControllerStatus(soap *, struct UserInfo userInfo,int &initStatus)
{
    p_powerManger->initControllerStatus( userInfo, initStatus );
    return 0;//必须有
}

int updateUserProgramFile(soap *, struct UserInfo userInfo,std::string fileName,std::string md5,int &returnFlag)
{
    p_powerManger-> updateUserProgramFile( userInfo , fileName, md5, returnFlag );
    return 0;//必须有
}

int changePointType(soap *,struct UserInfo userInfo,struct PointPro inputPointPro,struct PointPro &pointPro)
{
    p_powerManger-> changePointType( userInfo , inputPointPro, pointPro );
    return 0;//必须有
}

int changePasswd(soap *,struct UserInfo userInfo,int changeAccount,std::string oldPassed,std::string newPasswd,int &returnFlag)
{
    p_powerManger-> changePasswd( userInfo ,changeAccount, oldPassed, newPasswd , returnFlag );
    return 0;//必须有
}

int loginController(soap *,struct UserInfo userInfo,std::string hmiVersion,int &returnFlag)
{
    p_powerManger-> loginController_pchmi(userInfo , hmiVersion,returnFlag );
    return 0;//必须有
}

int setDo(soap *, struct UserInfo userInfo,int ioOutNum,int nOffOn,int &returnFlag)
{
    p_powerManger-> setDo( userInfo , ioOutNum, nOffOn, returnFlag );
    return 0;//必须有
}

int setManualSpeedPercent(soap *, struct UserInfo userInfo, float nSpeedValue, int &returnFlag)
{
    qDebug()<<"gsoap,setManualSpeedPercent:"<<nSpeedValue;
    p_powerManger-> setManualSpeedPercent( userInfo , nSpeedValue, returnFlag );
    return 0;//必须有
}

int setAutoSpeedPercent(soap *,struct UserInfo userInfo,float nSpeedValue,int &returnFlag)
{
    qDebug()<<"gsoap,setAutoSpeedPercent:"<<nSpeedValue;

    p_powerManger-> setAutoSpeedPercent( userInfo , nSpeedValue, returnFlag );
    return 0;//必须有
}

int setHandWheel(soap *,struct UserInfo userInfo,int axisNumber,int direction,int velocity,int &returnFlag)
{
    p_powerManger-> setHandWheel( userInfo , axisNumber, direction, velocity, returnFlag  );
    return 0;//必须有
}

int jogRun(soap *, struct UserInfo userInfo,int axisNumber,int direction,int &returnFlag)
{
    //喂狗
//    g_hmiGaoapQt->currentControllerToDog(userInfo.ip);

    qDebug()<<"gsoap,*****jogRun"<<axisNumber <<" ** "<<direction;

    p_powerManger-> jogRun( userInfo , axisNumber, direction, returnFlag  );
    return 0;//必须有
}

int setProgramFileName(soap *, struct UserInfo userInfo,std::string programFileName,int &returnFlag)
{
    p_powerManger-> setProgramFileName( userInfo , programFileName, returnFlag  );
    return 0;//必须有
}

int setProgramRunLine(soap *, struct UserInfo userInfo,int line,int &returnFlag)
{
    p_powerManger-> setProgramRunLine( userInfo , line, returnFlag  );
    return 0;//必须有
}

int setRunModel(soap *, struct UserInfo userInfo,int runModel,int &returnFlag)
{
    qDebug()<<"gsoap,setRunModel:"<<runModel;
    p_powerManger-> setRunModel( userInfo , runModel, returnFlag  );
    return 0;//必须有
}

int setDebugModel(soap *, struct UserInfo userInfo,int debugModel,int &returnFlag)
{
    p_powerManger-> setDebugModel( userInfo , debugModel, returnFlag  );
    return 0;//必须有
}

int setJogCoordinator(soap *, struct UserInfo userInfo,int coordinator,int &returnFlag)
{
    p_powerManger-> setJogCoordinator( userInfo , coordinator, returnFlag  );
    return 0;//必须有
}

int moveToPoint(soap *,struct UserInfo userInfo,struct MoveParameter moveParameter,int &returnFlag)
{
    p_powerManger-> moveToPoint( userInfo , moveParameter, returnFlag  );
    return 0;//必须有
}

int programRun(soap *, struct UserInfo userInfo,int &returnFlag)
{
    qDebug()<<"gsoap,*****run,programRun";
    p_powerManger-> programRun( userInfo ,  returnFlag  );
    return 0;//必须有
}

int programCease(soap *, struct UserInfo userInfo,int &returnFlag)
{
    //清除喂狗
//    g_hmiGaoapQt->clearControllerToDog(userInfo.ip);
    qDebug()<<"gsoap,*****pause,programCease";
    p_powerManger->programCease( userInfo ,  returnFlag );
    return 0;//必须有
}

int programReset(soap *, struct UserInfo userInfo,int &returnFlag)
{
    //清除喂狗
//    g_hmiGaoapQt->clearControllerToDog(userInfo.ip);

    qDebug()<<"gsoap,*****stop,programReset";
    p_powerManger->programReset( userInfo ,  returnFlag );
    return 0;//必须有
}

int returnZeroPoint(soap *, struct UserInfo userInfo,int axisNumber,int &returnFlag)
{
    qDebug()<<"gsoap,*****return zero" << axisNumber;
    p_powerManger->returnZeroPoint( userInfo ,  axisNumber, returnFlag );
    return 0;//必须有
}

int returnAllZeroPoint(soap *, struct UserInfo userInfo,int &returnFlag)
{
    p_powerManger->returnZeroPoint( userInfo , returnFlag );
    return 0;//必须有
}

int controllerShutDown(soap *, struct UserInfo userInfo,int &returnFlag)
{
    qDebug() << "gsoap,**********controllerShutDown*************"<<"\n\n\n\n\n";
    p_powerManger->controllerShutDown(userInfo,returnFlag);
    return 0;//必须有
}

int setManualServon(soap *, struct UserInfo userInfo,int nServOffOn,int &returnFlag)
{
    p_powerManger->setManualServon( userInfo ,  nServOffOn, returnFlag );
    return 0;//必须有
}

int setRegisterNumber(soap *, struct UserInfo userInfo,std::string registerString,struct  ReturnRegisterStatus &returnStatus)
{
    p_powerManger->setRegisterNumber( userInfo ,  registerString, returnStatus );
    return 0;//必须有
}

int getTcpConnectState(soap *, struct UserInfo userInfo,int &returnFlag)
{
#if 1
    //check the userInfo
    //ip验证是否符合
    regex_t reg;
    regmatch_t pmatch[1];
    const size_t nmatch = 1;
    char *pattern = "^(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])$";
    regcomp(&reg, pattern, REG_EXTENDED);
    int result = regexec(&reg, userInfo.ip.c_str(), nmatch, pmatch, 0);
    if (result != REG_NOERROR)
    {
        returnFlag = 0;         //= EM_CONNECT_FAIL
        return 0;               //匹配失败 结束
    }
    regfree(&reg);

    //密码验证?
    //userInfo.password;

    //userInfo.operationSystem;

    //userInfo.currentRobotIndex;
    returnFlag = 1;             //= EM_CONNECT_SUCCESS
#else
    p_powerManger->getTcpConnectState( userInfo ,  returnFlag );
#endif
    return 0;                   //匹配成功 结束
}

int setClearAllCounter(soap *, struct UserInfo userInfo,int &returnFlag)
{
    p_powerManger->setClearAllCounter( userInfo ,  returnFlag );
    return 0;//必须有
}

int setClearCurrentCounter(soap *, struct UserInfo userInfo,int &returnFlag)
{
    p_powerManger->setClearCurrentCounter( userInfo ,  returnFlag );
    return 0;//必须有
}

int setRestoreFactory(soap *, struct UserInfo userInfo,int &returnFlag)
{
    p_powerManger->setClearCurrentCounter( userInfo ,  returnFlag );
    return 0;//必须有
}

int setCoordMode(soap *, struct UserInfo userInfo,int nCoordId,int &returnFlag)
{
    p_powerManger->setCoordMode( userInfo ,  nCoordId, returnFlag );
    return 0;//必须有
}

int setMsgClear(soap *, struct UserInfo userInfo,int messageId,int &returnFlag)
{
    p_powerManger->setMsgClear( userInfo ,  messageId, returnFlag );
    return 0;//必须有
}

int setRobotSingleAxisCaliberate(soap *, struct UserInfo userInfo,int asixId,int &returnFlag)
{
    p_powerManger->setRobotSingleAxisCaliberate( userInfo,  asixId, returnFlag );
    return 0;//必须有
}

int setRobotAllAxisCaliberate(soap *, struct UserInfo userInfo, int &returnFlag)
{
    p_powerManger->setRobotAllAxisCaliberate( userInfo,  returnFlag );
    return 0;//必须有
}

int clearPlRegister(soap *, struct UserInfo userInfo,int palletNumber,int &returnFlag)
{
    p_powerManger->clearPlRegister( userInfo,  palletNumber, returnFlag );
    return 0;//必须有
}

int setPlRegister(soap *, struct UserInfo userInfo,int palletNumber,struct PlRegStruct plReg,int &returnFlag)
{
    p_powerManger->setPlRegister( userInfo,  palletNumber, plReg, returnFlag );
    return 0;//必须有
}

int clearAllPlRegister(soap *, struct UserInfo userInfo,int &returnFlag)
{
    p_powerManger->clearAllPlRegister( userInfo,  returnFlag );
    return 0;//必须有
}

int setLocalRegister(soap *, struct UserInfo userInfo,int number, double value,int &returnFlag)
{
    p_powerManger->setLocalRegister( userInfo,  number, value, returnFlag );
    return 0;//必须有
}

int clearAllLocalRegister(soap *, struct UserInfo userInfo,int &returnFlag)
{
    p_powerManger->clearAllLocalRegister( userInfo,  returnFlag );
    return 0;//必须有
}

int setGlobalRegister(soap *, struct UserInfo userInfo,int number, double value,int &returnFlag)
{
    p_powerManger->setGlobalRegister( userInfo,  number, value ,returnFlag );
    return 0;//必须有
}

int clearAllGlobalRegister(soap *, struct UserInfo userInfo,int &returnFlag)
{
    p_powerManger->clearAllGlobalRegister( userInfo,  returnFlag );
    return 0;//必须有
}

int clearAllPrRegister(soap *, struct UserInfo userInfo,int &returnFlag)
{
    p_powerManger->clearAllPrRegister( userInfo,  returnFlag );
    return 0;//必须有
}

int setPrRegister(soap *, struct UserInfo userInfo,int number,struct PointPro point,int &returnFlag)
{
    p_powerManger->setLocalPrRegister( userInfo,  number, point,  returnFlag );
    return 0;//必须有
}

//int updateControllerProgram(soap *, struct UserInfo userInfo,std::string fileLocation,int &returnFlag){}

//int restoreControllerProgramBackupFile(soap *, struct UserInfo userInfo,std::string fileLocation,int &returnFlag){}

int backupControllerProgram(soap *, struct UserInfo userInfo,std::string fileLocation,int &returnFlag)
{
    p_powerManger->backupControllerProgram( userInfo,  fileLocation,  returnFlag );
    return 0;//必须有
}

//int restoreFactory(soap *, struct UserInfo userInfo,int &returnFlag){}

int setIpAddress(soap *, struct UserInfo userInfo,struct ControllerIpGroupInfo controllerIpGroupInfo,int &returnFlag)
 {
     p_powerManger->setIpAddress( userInfo,  controllerIpGroupInfo,  returnFlag );
     return 0;//必须有
 }

int setMacAddress(soap *, struct UserInfo userInfo,std::string macAddress,int &returnFlag)
{
    p_powerManger->setMacAddress( userInfo,  macAddress,  returnFlag );
    return 0;//必须有
}

//int readDefaultFileName(soap *, struct UserInfo userInfo,int &returnFlag)
int readDefaultFileName(  soap*, struct UserInfo userInfo, std::string &returnName)
{
    p_powerManger->readDefaultFileName( userInfo,  returnName );
    return 0;//必须有
}

int setLanguage(  soap*, struct UserInfo userInfo, int languageID, int &returnFlag){
    p_powerManger->setLanguage(userInfo,languageID,returnFlag);
    return 0;//必须有
}

int jogRunDog( soap*,struct UserInfo userInfo,int &returnFlag){
//    g_hmiGaoapQt->currentControllerToDog(userInfo.ip);
    p_powerManger->feedDog();
    return 0;//必须有
}

int calculateToolCoordinate(soap*,struct UserInfo userInfo, int robotID,
                            struct HmiToolCoordinateInformation sendToolCoordinate,
                            struct HmiToolCoordinateInformation &resultToolCoordinate)
{
    p_powerManger->calculateToolCoordinate(userInfo,robotID,sendToolCoordinate,resultToolCoordinate);
    return 0;//必须有
}

int calculateUserCoordinate(soap*,struct UserInfo userInfo, int robotID,
                            struct HmiUserCoordinateInformation sendUserCoordinate,
                            struct HmiUserCoordinateInformation &resultUserCoordinate)
{
    p_powerManger->calculateUserCoordinate(userInfo,robotID,sendUserCoordinate,resultUserCoordinate);
    return 0;//必须有
}

int setAllMsgClear(soap*,struct UserInfo userInfo,int &returnFlag)
{
    p_powerManger->setAllMsgClear(userInfo,returnFlag);
    return 0;//必须有
}

int setSo(soap*, struct UserInfo userInfo, int soNum, int nOffOn, int &returnFlag)
{
    p_powerManger-> setSo( userInfo , soNum, nOffOn, returnFlag );
    return 0;//必须有
}

int setAo(soap*,struct UserInfo userInfo,int aoNum,double aoValue,int &returnFlag)
{
    p_powerManger-> setAo( userInfo , aoNum, aoValue, returnFlag );
    return 0;//必须有
}

int changeAxisLimit(soap*,struct UserInfo userInfo,std::vector<struct AxisLimit> changeLimit,int &returnFlag)
{
    return 0;//必须有
}

int getStoreStatus(soap*,struct UserInfo userInfo,struct StoreStatus &storeStatus)
{
    return 0;//必须有
}

int getToolCoordinateInformation(soap*,struct UserInfo userInfo, int robotID,
                                 std::vector<struct HmiToolCoordinateInformation> &toolList)
{
    p_powerManger->getToolCoordinateInformation(userInfo,robotID,toolList);
    return 0;//必须有
}

int getUserCoordinateInformation(soap*,struct UserInfo userInfo, int robotID,
                                 std::vector<struct HmiUserCoordinateInformation> &userList)
{
    p_powerManger->getUserCoordinateInformation(userInfo,robotID,userList);
    return 0;//必须有
}

int changeSafePoint(soap*,struct UserInfo userInfo,struct PointPro safePoint,int &returnFlag)
{
    return 0;//必须有
}

int setSafePoint(soap*,struct UserInfo userInfo,bool value,int &returnFlag)
{
    return 0;//必须有
}

int setTimerRegister(soap*,struct UserInfo userInfo,int timerNumber,int changeStatus,int &returnFlag)
{
    p_powerManger->setTimerReg(userInfo,timerNumber,changeStatus,returnFlag);
    return 0;//必须有
}

int setStartType(soap*, struct UserInfo userInfo, int type, std::string &returnString)
{
    p_powerManger->setStartType(userInfo,type,returnString);
    return 0;//必须有
}

int connectVrep(soap*,struct UserInfo userInfo,std::string ip,int port,int &returnFlag){
    p_powerManger->connectVrep(userInfo,ip,port,returnFlag);
    return 0;//必须有
}

int disconnectVrep(soap*,struct UserInfo userInfo,int &returnFlag){
    p_powerManger->disconnectVrep(userInfo,returnFlag);
    return 0;//必须有
}

int setVrepServoType(soap*,struct UserInfo userInfo,int type,int &returnFlag){
    p_powerManger->setVrepServoType(userInfo,type,returnFlag);
    return 0;//必须有
}

int setVrepIoType(soap*,struct UserInfo userInfo,int type,int &returnFlag){
    p_powerManger->setVrepIoType(userInfo,type,returnFlag);
    return 0;//必须有
}

int feedWatchDog(soap*,struct UserInfo userInfo,int &returnFlag)
{
   p_powerManger->feedDog(userInfo,returnFlag);
   return 0;//必须有
}


int backupFile(soap*,struct UserInfo userInfo,int backUpType,int diskType,
               std::string fileName,int robotId,int &returnFlag)
{
    p_powerManger->backupFile(userInfo,backUpType,diskType,fileName,robotId,returnFlag);
    return 0;//必须有
}

int restoreFile(soap*,struct UserInfo userInfo,int backUpType,int diskType,
                std::string fileName, int robotId,int &returnFlag)
{
    p_powerManger->restoreFile(userInfo,backUpType,diskType,fileName,robotId,returnFlag);
    return 0;//必须有
}

int getFileList(soap*,struct UserInfo userInfo,int pathType,vector<string>& fileList)
{
    p_powerManger->getBackupFileList(userInfo,pathType,fileList);
    return 0;//必须有
}

int clearMotorBatteryError(soap*,UserInfo userInfo,int &returnFlag)
{
    p_powerManger->clearMotorBatteryError(userInfo,returnFlag);
    return 0;//必须有
}

int controlShutDownEnable(soap*,UserInfo userInfo,bool enable,int &returnFlag)
{
    p_powerManger->controlShutDownEnable(userInfo,enable,returnFlag);
    return 0;//必须有
}

int setEthercatMotorDcUserMode(soap*,struct UserInfo userInfo,int robID,int &returnFlag)
{
    p_powerManger->setEthercatMotorDcUserMode(userInfo,robID,returnFlag);
    return 0;//必须有
}

int setEthercatDeviceAlias(soap*,struct UserInfo userInfo,int node, unsigned short alias,int &returnFlag)
{
    p_powerManger->setEthercatDeviceAlias(userInfo,node,alias,returnFlag);
    return 0;//必须有
}

int getEthercatSlavesInformation(soap*,struct UserInfo userInfo,std::vector<EcatBusDevInfo_gsoap>& slavesInfo )
{
    p_powerManger->getEthercatSlavesInformation(userInfo,slavesInfo);
    return 0;//必须有
}

int getMotionServerDebugInfo(soap*,struct UserInfo userInfo,MotionDebugInfo& infoOut)
{
    p_powerManger->getMotionServerDebugInfo(userInfo,infoOut);
    return 0;//必须有
}

int getProgramEngineDebugInfo(soap*,struct UserInfo userInfo,ProgramEngineDebugInfo &infoOut)
{
    p_powerManger->getProgramEngineDebugInfo(userInfo,infoOut);
    return 0;//必须有
}

int getCalibrateInformation(soap*,struct UserInfo userInfo,
                            struct S_AXISGROUP_ZERO_INFORMATION& zeroInformationOut)
{
    p_powerManger->getCalibrateInformation(userInfo,zeroInformationOut);
    return 0;//必须有
}

int allowSingleAxisJog(soap*,struct UserInfo userInfo,bool enable,int &returnFlag)
{
    p_powerManger->allowSingleAxisJog(userInfo,enable,returnFlag);
    return 0;//必须有
}

int clearCurrentProduction(soap*,struct UserInfo userInfo,int &returnFlag)
{
    p_powerManger->clearCurrentProduction(userInfo,returnFlag);
    return 0;//必须有
}

int clearAccumulatedProduction(soap*,struct UserInfo userInfo,int &returnFlag)
{
    p_powerManger->clearAccumulatedProduction(userInfo,returnFlag);
    return 0;//必须有
}

int setAllManualServon(soap*,struct UserInfo userInfo,int nServOffOn,int &returnFlag)
{
    p_powerManger->setAllManualServon(userInfo,nServOffOn,returnFlag);
    return 0;//必须有
}

int setAllRunModel(soap*,struct UserInfo userInfo,int runModel,int &returnFlag)
{
    p_powerManger->setAllRunModel(userInfo,runModel,returnFlag);
    return 0;//必须有
}

int programAllRun(soap*,struct UserInfo userInfo,int &returnFlag)
{
    p_powerManger->programAllRun(userInfo,returnFlag);
    return 0;//必须有
}

int programAllCease(soap*,struct UserInfo userInfo,int &returnFlag)
{
    p_powerManger->programAllCease(userInfo,returnFlag);
    return 0;//必须有
}

int programAllReset(soap*,struct UserInfo userInfo,int &returnFlag)
{
    p_powerManger->programAllReset(userInfo,returnFlag);
    return 0;//必须有
}

int getProgramEngineDebugInfoList(soap*,struct UserInfo userInfo,
                                  std::vector<ProgramEngineDebugInfo> &infoListOut)
{
    p_powerManger->getProgramEngineDebugInfoList(userInfo,infoListOut);
    return 0;//必须有
}

int getTaskInfo(soap*,struct UserInfo userInfo, TaskManagerInfo &taskManagerInfo)
{
    p_powerManger->getTaskInfo(userInfo,taskManagerInfo);
    return 0;//必须有
}

int getAllTaskInfo(soap*,struct UserInfo userInfo, std::vector<struct TaskManagerInfo> &taskManagerInfo)
{
   p_powerManger->getAllTaskInfo(userInfo,taskManagerInfo);
   return 0;//必须有
}

int getSdo(soap*,struct UserInfo userInfo,  int robID,int axis,int rObIndex,int rObSubIndex,LONG64 &rData )
{
     p_powerManger->getSdo(userInfo,robID,axis,rObIndex,rObSubIndex,rData);
     return 0;//必须有
}

int  setSdo(soap*,struct UserInfo userInfo, int robID, int axis,int wObIndex,int wObSubIndex,LONG64 wData
            ,int wDataLen ,int &returnFlag )
{
    p_powerManger->setSdo(userInfo,robID,axis,wObIndex,wObSubIndex,wData,wDataLen,returnFlag);
    return 0;//必须有
}



//***************AGV接口函数部分 ros->agvBaseControl********************************

//int addMessage(soap*,struct UserInfo userInfo,struct Message addMsgLog,int &returnFlag)
//{
//    p_powerManger->addMessage(userInfo,addMsgLog,returnFlag);
//    return 0;//必须有
//}



int getOdometer(soap*,struct UserInfo userInfo,int robotIdIn,struct OdemeterData& odemeterDataReturn)
{
    p_powerManger->getOdometer(userInfo,robotIdIn,odemeterDataReturn.vel,odemeterDataReturn.pos);
    return 0;//必须有
}

int vehicleAuto(soap*,struct UserInfo userInfo,int robotIdIn, double xMove, double yMove,
                double rotate,int &returnFlag)
{
    p_powerManger->vehicleJog(userInfo,robotIdIn,xMove ,yMove,rotate);
    returnFlag=0;
    return 0;//必须有
}

int  getWheelMoveSpeed(soap*, struct UserInfo userInfo, int robotIdIn,
                  std::vector<double >&wheelMoveSpeed)
{
    std::vector<double > wheelPathLength;
    p_powerManger->getWheelData(userInfo,robotIdIn,wheelMoveSpeed,wheelPathLength);
    return 0;//必须有
}

int  getWheelPathLength(soap*, struct UserInfo userInfo, int robotIdIn,
                  std::vector<double >&wheelPathLength)
{
    std::vector<double > wheelMoveSpeed;
    p_powerManger->getWheelData(userInfo,robotIdIn,wheelMoveSpeed,wheelPathLength);
    return 0;//必须有
}

//***************AGV接口函数部分 hmi->agvBaseControl->********************************
//地图
int setMapSolver(soap*,struct UserInfo userInfo,enum E_MAP_SOLVER solverIn,
                 int laserCount,int &returnFlag)
{

    p_powerManger->setMapSolver(userInfo,solverIn,laserCount,returnFlag);
    return 0;//必须有

}
int createMapStart(soap*,struct UserInfo userInfo,int &returnFlag)
{
    p_powerManger->createMapStart(userInfo,returnFlag);
    return 0;//必须有
}
int createMapEnd(soap*,struct UserInfo userInfo,std::string mapName,int &returnFlag)
{
    p_powerManger->createMapEnd(userInfo,mapName,returnFlag);
    return 0;//必须有
}
int loadMap(soap*,struct UserInfo userInfo,std::string mapName,int &returnFlag)
{
    p_powerManger->loadMap(userInfo,mapName,returnFlag);
    return 0;//必须有
}

int deleteMap(soap*,struct UserInfo userInfo,std::string mapName,int &returnFlag)
{
    p_powerManger->deleteMap(userInfo,mapName,returnFlag);
    return 0;//必须有
}

//添加虚拟墙
int addVitrualBlock(soap*,struct UserInfo userInfo,std::string configFilePath,int &returnFlag)
{
    p_powerManger->addVitrualBlock(userInfo,configFilePath,returnFlag);
    return 0;//必须有
}
int deleteVitrualBlock(soap*,struct UserInfo userInfo,int &returnFlag)
{
    p_powerManger->deleteVitrualBlock(userInfo,returnFlag);
    return 0;//必须有
}
int addForbidenZone(soap*,struct UserInfo userInfo,double x_start,double y_start
                    ,double x_end,double y_end,int &returnFlag)
{
    p_powerManger->addForbidenZone(userInfo,x_start,y_start,x_end,y_end,returnFlag);
    return 0;//必须有
}



//定位
int setOdomSolver(soap*,struct UserInfo userInfo,enum E_ODOM_SOLVER solverIn,int &returnFlag)
{
    p_powerManger->setOdomSolver(userInfo,solverIn,returnFlag);
    return 0;//必须有
}
int setLocationSolver(soap*,struct UserInfo userInfo,enum E_LOCATION_SOLVER solverIn,int &returnFlag)
{
    p_powerManger->setLocationSolver(userInfo,solverIn,returnFlag);
    return 0;//必须有
}
int getVehiclePosition(soap*,struct UserInfo userInfo,struct VehiclePosition& positionReturn)
{
    p_powerManger->getVehiclePosition(userInfo,positionReturn);
    return 0;//必须有
}
int setVehiclePosition(soap*,struct UserInfo userInfo,struct VehiclePosition positionIn,int &returnFlag)
{
    p_powerManger->setVehiclePosition(userInfo,positionIn,returnFlag);
    return 0;//必须有
}

//轨迹规划和行驶
int setReplanCoutLimitWhenFailure(soap*,struct UserInfo userInfo,int countLimit,int &returnFlag)
{
    p_powerManger->setReplanCoutLimitWhenFailure(userInfo,countLimit,returnFlag);
    return 0;//必须有
}
int setTrajectoryGlobalPlanSolver(soap*,struct UserInfo userInfo,enum E_TRAJECTORY_GLOBAL_SOLVER solverIn,int &returnFlag)
{
    p_powerManger->setTrajectoryGlobalPlanSolver(userInfo,solverIn,returnFlag);
    return 0;//必须有
}
int setTrajectoryLocalPlanSolver(soap*,struct UserInfo userInfo,enum E_TRAJECTORY_LOCAL_SOLVER solverIn,int &returnFlag)
{
    p_powerManger->setTrajectoryLocalPlanSolver(userInfo,solverIn,returnFlag);
    return 0;//必须有
}
int moveToPosition(soap*,struct UserInfo userInfo,struct VehiclePosition positionIn,
                   double velocity,int &returnFlag)
{
    p_powerManger->moveToPosition(userInfo,positionIn,velocity,returnFlag);
    return 0;//必须有
}
int moveFollowPath(soap*,struct UserInfo userInfo,std::vector<struct VehiclePosition> pathIn,
                   double velocity,int &returnFlag)
{
    p_powerManger->moveFollowPath(userInfo,pathIn,velocity,returnFlag);
    return 0;//必须有
}
int changeVelocity(soap*,struct UserInfo userInfo,double velocity,int &returnFlag)
{
    p_powerManger->changeVelocity(userInfo,velocity,returnFlag);
    return 0;//必须有
}
int getMovingStatus(soap*,struct UserInfo userInfo,enum E_GOAL_STATUS& status)
{
    p_powerManger->getMovingStatus(userInfo,status);
    return 0;//必须有
}
int getRemainningTime(soap*,struct UserInfo userInfo,double &timeOut)
{
    p_powerManger->getRemainningTime(userInfo,timeOut);
    return 0;//必须有
}
int getRemainningDistance(soap*,struct UserInfo userInfo,double &distanceOut)
{
    p_powerManger->getRemainningDistance(userInfo,distanceOut);
    return 0;//必须有
}
int ceaseMotion(soap*,struct UserInfo userInfo,int &returnFlag)
{
    p_powerManger->ceaseMotion(userInfo,returnFlag);
    return 0;//必须有
}
int startMotion(soap*,struct UserInfo userInfo,int &returnFlag)
{
    p_powerManger->startMotion(userInfo,returnFlag);
    return 0;//必须有
}
int cancelMotion(soap*,struct UserInfo userInfo,int &returnFlag)
{
    p_powerManger->cancelMotion(userInfo,returnFlag);
    return 0;//必须有
}

//设置
int setPositionArrivedAccuracy(soap*,struct UserInfo userInfo,double accuracyIn,int &returnFlag)
{
    p_powerManger->setPositionArrivedAccuracy(userInfo,accuracyIn,returnFlag);
    return 0;//必须有
}
int setLocalPlanRange(soap*,struct UserInfo userInfo,double rangeIn,int &returnFlag)
{
    p_powerManger->setLocalPlanRange(userInfo,rangeIn,returnFlag);
    return 0;//必须有
}
int setVehicleBorderOffset(soap*,struct UserInfo userInfo,std::vector<double> point_x, std::vector<double> point_y,int &returnFlag)
{
    p_powerManger->setVehicleBorderOffset(userInfo,point_x,point_y,returnFlag);
    return 0;//必须有
}
int setGlobalBarrierOffset(soap*,struct UserInfo userInfo,double offsetIn,int &returnFlag)
{
    p_powerManger->setGlobalBarrierOffset(userInfo,offsetIn,returnFlag);
    return 0;//必须有
}
int setLocalBarrierOffset(soap*,struct UserInfo userInfo,double offsetIn,int &returnFlag)
{
    p_powerManger->setLocalBarrierOffset(userInfo,offsetIn,returnFlag);
    return 0;//必须有
}
int resetRosAll(soap*,struct UserInfo userInfo,int &returnFlag)
{
    p_powerManger->resetRosAll(userInfo,returnFlag);
    return 0;//必须有
}

//状态
int getRosPackageStatus(soap*,struct UserInfo userInfo,enum E_ROS_PACKAGE package,enum E_ROS_PACKAGE_STATUS &status)
{
    p_powerManger->getRosPackageStatus(userInfo,package,status);
    return 0;//必须有
}

//IMU校准
int startImuCalibrate(soap*,struct UserInfo userInfo,int &returnFlag)
{
    p_powerManger->startImuCalibrate(userInfo,returnFlag);
}
int stopImuCalibrate(soap*,struct UserInfo userInfo,int &returnFlag)
{
    p_powerManger->stopImuCalibrate(userInfo,returnFlag);
}

int restartNfsService( soap*, struct UserInfo userInfo, int &returnFlag)
{
    p_powerManger->restartNfsService(userInfo,returnFlag);
    return 0;//必须有
}

int getCurrentMapName(soap*, struct UserInfo userInfo,std::string &mapNameReturn)
{
    p_powerManger->getCurrentMapName(userInfo,mapNameReturn);
    return 0;//必须有
}

//设置类命令
int manual_stop(soap*, struct UserInfo userInfo,int &returnFlag)
{
    qDebug()<<"ｇｓｏａｐ ,, jogStop";
    p_powerManger->jogStop(userInfo);
    returnFlag=1;
    return 0;//必须有
}
int clear_odomter(soap*, struct UserInfo userInfo,int &returnFlag)
{
    p_powerManger->resetCustomOdometer_positionManage(userInfo,returnFlag);
    returnFlag=1;
    return 0;//必须有
}
int calibrateVehicle(soap*, struct UserInfo userInfo,double xOffset,double yOffset,double rOffset,int &returnFlag)
{
    p_powerManger->calibrateVehicle(userInfo,xOffset,yOffset,rOffset,returnFlag);
    return 0;//必须有
}
int setVehicleBorderOffset_rect(soap*, struct UserInfo userInfo,double front_offsetIn,double back_offsetIn,
                           double left_offsetIn,double right_offsetIn,int &returnFlag)
{
    p_powerManger->setVehicleBorderOffset(userInfo,front_offsetIn,back_offsetIn,left_offsetIn,
                                                 right_offsetIn);
    returnFlag=1;
    return 0;//必须有
}

//获取类命令
int get_vehicle_basic_info(soap*, struct UserInfo userInfo,struct VehicleBasicInfo &basicInfoReturn)
{
    p_powerManger->getVehicleSpeedFeedback(userInfo,basicInfoReturn.vehicleVelocityFeedback);
    p_powerManger->getOdometer_positionManage(userInfo,basicInfoReturn.odometer_history, basicInfoReturn.time_history,
                        basicInfoReturn.odometer_user, basicInfoReturn.time_user);
    BatteryInformation batteryInfoOut;
    p_powerManger->getBatteryInfo(batteryInfoOut);
    basicInfoReturn.batteryLightModeLeft=batteryInfoOut.batteryLeftLightmodRatio;
    p_powerManger->getPointCloudSafeStatus(basicInfoReturn.pointSensorName,basicInfoReturn.pointSensorSafeRatio,
                                    basicInfoReturn.pointSensorCheckEnable);
    p_powerManger->getUltrasonicSensorSafeStatus(basicInfoReturn.ultrasonicSafeStatus,basicInfoReturn.ultrasonicCheckEnable);
    p_powerManger->getUltrasonicDetectDistance(basicInfoReturn.ultrasonicDistance);
//    p_powerManger->getTargetCommandVehiclePosition(userInfo,basicInfoReturn.targetPosition);
    VirtualLineDebugInfo virtualInfoOut;
    p_powerManger->getVirtualLineControlDebugInfo(userInfo,virtualInfoOut);
    basicInfoReturn.absoluteDistanceLeft=virtualInfoOut.absoluteDistance;
    basicInfoReturn.absoluteAngleLeft=virtualInfoOut.absoluteAngle;

    return 0;//必须有
}
int get_map_list(soap*, struct UserInfo userInfo,std::vector<string> &mapNameListReturn)
{
    p_powerManger->getMapNameList(userInfo,mapNameListReturn);
    return 0;//必须有
}

int getAllPointCloud_translated(soap*,struct UserInfo userInfo,std::vector<PointCloudData_3D> &pointCloudOut)
{
    p_powerManger->getAllPointCloud_translated(userInfo,pointCloudOut);
    return 0;//必须有
}

int getCarBorder(soap*,struct UserInfo userInfo,std::vector<struct VehiclePosition> &carBorderOut)
{
    p_powerManger->getCarBorder(userInfo,carBorderOut);
    return 0;//必须有
}
int getCarBorderOffset(soap*,struct UserInfo userInfo,std::vector<struct VehiclePosition> &carBorderOffsetOut)
{
    p_powerManger->getCarBorderOffset(userInfo,carBorderOffsetOut);
    return 0;//必须有
}

int getVehiclePosition_specified(soap*,struct UserInfo userInfo,int typeIn,struct PositionInfo_hmi &positionReturn)
{
    p_powerManger->getVehiclePosition_specified(userInfo,typeIn,positionReturn);
    return 0;//必须有
}

int setCurrentVMarkIndex(soap*,struct UserInfo userInfo,int indexIn,int &returnFlag)
{
    p_powerManger->setCurrentVMarkIndex(userInfo,indexIn,returnFlag);
    return 0;//必须有
}
int setCurrentVMarkType(soap*,struct UserInfo userInfo,int currentVmarkTypeIn,int &returnFlag)
{
    p_powerManger->setCurrentVMarkType(userInfo,currentVmarkTypeIn,returnFlag);
    return 0;//必须有
}
int getVmarkInfoList(soap*,struct UserInfo userInfo, std::vector<struct VMarkInfo> &vmarkInfoOut)
{
    p_powerManger->getVmarkInfoList(userInfo,vmarkInfoOut);
    return 0;//必须有
}
int updateVMarkFile(soap*,struct UserInfo userInfo,std::string vmarkFileIn,int &returnFlag)
{
    p_powerManger->updateVMarkFile(userInfo,vmarkFileIn,returnFlag);
    return 0;//必须有
}
int createVMark(soap*,struct UserInfo userInfo, struct VMarkInfo infoIn, std::string vmarkFileIn, int &returnFlag)
{
    p_powerManger->createVMark(userInfo,infoIn,vmarkFileIn,returnFlag);
    return 0;//必须有
}
int getVMarkPositionInWorld(soap*,struct UserInfo userInfo, struct PositionInfo_hmi &positionReturn)
{
    p_powerManger->getVMarkPositionInWorld(userInfo,positionReturn);
    return 0;//必须有
}
int getMatchDebugInfo_vmark(soap*,struct UserInfo userInfo,struct VisionMatchDebugInfo &infoOut)
{
    p_powerManger->getMatchDebugInfo_vmark(userInfo,infoOut);
    return 0;//必须有
}
int setLaserFilterByType_vmark(soap*,struct UserInfo userInfo,int typeIn,int &returnFlag)
{
    p_powerManger->setLaserFilterByType_vmark(userInfo,typeIn,returnFlag);
    return 0;//必须有
}

int setUltrasonicSensorCheckEnable(soap*,struct UserInfo userInfo,bool isOn,int &returnFlag)
{
    p_powerManger->setUltrasonicSensorCheckEnable(userInfo,isOn,returnFlag);
    return 0;//必须有
}
int setPointCloudCheckEnable(soap*,struct UserInfo userInfo,bool isOn,int &returnFlag)
{
    p_powerManger->setPointCloudCheckEnable(userInfo,isOn,returnFlag);
    return 0;//必须有
}
int moveToNavgationPoint(soap*,struct UserInfo userInfo,struct MovingToNavagationParameter parameterIn,int &returnFlag)
{
    p_powerManger->moveToNavgationPoint(userInfo,parameterIn,returnFlag);
    return 0;//必须有
}

int setDefaultMapName(soap*,struct UserInfo userInfo,std::string fileNameIn, int &returnFlag)
{
    p_powerManger->setDefaultMapName(userInfo,fileNameIn,returnFlag);
    return 0;//必须有
}
int setCheckVehiclePosition_amcl(soap*,struct UserInfo userInfo,bool isCheck,int &returnFlag)
{
    p_powerManger->setCheckVehiclePosition_amcl(userInfo,isCheck,returnFlag);
    return 0;//必须有
}
int setLaserIntensityFilterByType_visionMatch(soap*,struct UserInfo userInfo,int typeIn,int &returnFlag)
{
    p_powerManger->setLaserIntensityFilterByType_visionMatch(userInfo,typeIn,returnFlag);
    return 0;//必须有
}

int setDefaultProgramFile(soap*,struct UserInfo userInfo,std::string inProgramName,int &returnFlag)
{
    p_powerManger->setDefaultProgramFile(userInfo,inProgramName,returnFlag);
    return 0;//必须有
}

int getRobotProgramFileList(soap*,struct UserInfo userInfo,std::vector<std::string> &programFileListOut)
{
    p_powerManger->getRobotProgramFileList(userInfo,programFileListOut);
    return 0;//必须有
}
int readRobotProgramFile(soap*,struct UserInfo userInfo,std::string fileName, std::vector <std::string> &fileStringOut)
{
    p_powerManger->readRobotProgramFile(userInfo,fileName,fileStringOut);
    return 0;//必须有
}
int writeRobotProgramFile(soap*,struct UserInfo userInfo,std::string fileName, std::vector <std::string> fileStringIn,int &returnFlag)
{
    p_powerManger->writeRobotProgramFile(userInfo,fileName,fileStringIn,returnFlag);
    return 0;//必须有
}
int get_robot_program_files_strings(soap*,struct UserInfo userInfo,int languageId,struct RunningProgramInfo &infoOut)
{
    //gsoap 不支持vector<vector<>>
    p_powerManger->get_robot_program_files_strings(userInfo,languageId,infoOut);
//    qDebug()<<"gsoap,programStrings.size()="<<infoOut.programStrings.size();
    return 0;//必须有
}

int get_running_program_file_strings(soap*,struct UserInfo userInfo,int languageId,std::string fileName,
                                     std::vector<std::string> &infoOut)
{
        p_powerManger->get_running_program_file_strings(userInfo,languageId,fileName,infoOut);
        return 0;//必须有
}

// Get Control IO
int get_di_names_info(soap*,struct UserInfo userInfo,std::vector<std::string> &namesOut)
{
    p_powerManger->get_di_names_info(userInfo,namesOut);
    return 0;//必须有
}
int get_do_names_info(soap*,struct UserInfo userInfo,std::vector<std::string> &namesOut)
{
    p_powerManger->get_do_names_info(userInfo,namesOut);
    return 0;//必须有
}
int get_ai_names_info(soap*,struct UserInfo userInfo,std::vector<std::string> &namesOut)
{
    p_powerManger->get_ai_names_info(userInfo,namesOut);
    return 0;//必须有
}
int get_ao_names_info(soap*,struct UserInfo userInfo,std::vector<std::string> &namesOut)
{
    p_powerManger->get_ao_names_info(userInfo,namesOut);
    return 0;//必须有
}
int get_si_names_info(soap*,struct UserInfo userInfo,std::vector<std::string> &namesOut)
{
    p_powerManger->get_si_names_info(userInfo,namesOut);
    return 0;//必须有
}
int get_so_names_info(soap*,struct UserInfo userInfo,std::vector<std::string> &namesOut)
{
    p_powerManger->get_so_names_info(userInfo,namesOut);
    return 0;//必须有
}

// Set Control IO
int set_di_name_info(soap*,struct UserInfo userInfo,int indexIn,std::string nameIn,int &returnFlag)
{
    p_powerManger->set_di_name_info(userInfo,indexIn,nameIn,returnFlag);
    return 0;//必须有
}
int set_do_name_info(soap*,struct UserInfo userInfo,int indexIn,std::string nameIn,int &returnFlag)
{
    p_powerManger->set_do_name_info(userInfo,indexIn,nameIn,returnFlag);
    return 0;//必须有
}
int set_ai_name_info(soap*,struct UserInfo userInfo,int indexIn,std::string nameIn,int &returnFlag)
{
    p_powerManger->set_ai_name_info(userInfo,indexIn,nameIn,returnFlag);
    return 0;//必须有
}
int set_ao_name_info(soap*,struct UserInfo userInfo,int indexIn,std::string nameIn,int &returnFlag)
{
    p_powerManger->set_ao_name_info(userInfo,indexIn,nameIn,returnFlag);
    return 0;//必须有
}
int set_si_name_info(soap*,struct UserInfo userInfo,int indexIn,std::string nameIn,int &returnFlag)
{
    p_powerManger->set_si_name_info(userInfo,indexIn,nameIn,returnFlag);
    return 0;//必须有
}
int set_so_name_info(soap*,struct UserInfo userInfo,int indexIn,std::string nameIn,int &returnFlag)
{
    p_powerManger->set_so_name_info(userInfo,indexIn,nameIn,returnFlag);
    return 0;//必须有
}

int getAllIoNamesinfo(soap*, struct UserInfo userInfo, struct IOMapNamesInfo &nameOut)
{
    p_powerManger->get_All_IO_NamesInfo(userInfo,nameOut);
    return 0;
}

int removeRobotProgramFile(soap*,struct UserInfo userInfo, std::string fileName, int &returnFlag)
{
    p_powerManger->removeRobotProgramFile(userInfo, fileName, returnFlag);
    return 0;
}

int getRobotLogFileInfo(soap*,struct UserInfo userInfo, std::vector< struct Message > &messagesLogOut)
{
    p_powerManger->getRobotLogFileInfo(userInfo, messagesLogOut);
    return 0;
}

int getSafeCollisionInfo(soap*,struct UserInfo userInfo,int sensorType, struct CollisionPara &infoOut)
{
    p_powerManger->getSafeCollisionInfo(userInfo, sensorType,infoOut);
    return 0;
}

int setSafeCollisionInfo(soap*,struct UserInfo userInfo, int sensorType, struct CollisionPara infoIn, int &returnFlag)
{
    p_powerManger->setSafeCollisionInfo(userInfo, sensorType,infoIn,returnFlag);
    return 0;
}

int getQrcodeDebugInfo(soap*,struct UserInfo userInfo,struct QrcodeDebugInfo &infoOut)
{
    p_powerManger->getQrcodeDebugInfo(userInfo, infoOut);
    return 0;
}

int getAllReferenceMarks(soap*,struct UserInfo userInfo,std::vector<struct ReflectMarkInfo> &reflectMarksOut)
{
    p_powerManger->getAllReferenceMarks(userInfo, reflectMarksOut);
    return 0;
}
int addReferenceMarkToMap(soap*,struct UserInfo userInfo,struct ReflectMarkInfo markIn,int &returnFlag)
{
    p_powerManger->addReferenceMarkToMap(userInfo,markIn, returnFlag);
    return 0;
}
int saveReferenceMarkToFile(soap*,struct UserInfo userInfo,std::string fileNameIn,int &returnFlag)
{
    p_powerManger->saveReferenceMarkToFile(userInfo, fileNameIn,returnFlag);
    return 0;
}
int deleteReferenceMarkInMap(soap*,struct UserInfo userInfo,int uniqId,int &returnFlag)
{
    p_powerManger->deleteReferenceMarkInMap(userInfo, uniqId,returnFlag);
    return 0;
}
int getReflectDebugInfo(soap*,struct UserInfo userInfo,struct ReflectDebugInfo &matchDebugInfoOut)
{
    p_powerManger->getReflectDebugInfo(userInfo, matchDebugInfoOut);
    return 0;
}
int setOriginalLaserFilterType(soap*,struct UserInfo userInfo,int typeIn,int &returnFlag)
{
    p_powerManger->setOriginalLaserFilterType(userInfo, typeIn,returnFlag);
    return 0;
}

int calculateZeroOffset(soap*,struct UserInfo userInfo,std::vector<struct PointPro> pointList,
                        struct AxisZeroOffsetInfo &returnInfo)
{
    p_powerManger->calculateZeroOffset(userInfo, pointList,returnInfo);
    return 0;
}
int calibrateRobotByOffset(soap*,struct UserInfo userInfo,std::vector<double> offsetIn,int &returnFlag)
{
    p_powerManger->calibrateRobotByOffset(userInfo, offsetIn,returnFlag);
    return 0;
}
int getFleetMap(soap*,struct UserInfo userInfo,std::string mapName,std::string &mapInfoReturn)
{
    p_powerManger->getFleetMap(userInfo, mapName,mapInfoReturn);
    return 0;
}
int writeFleetMap(soap*,struct UserInfo userInfo,std::string mapName,std::string mapInfoIn,int &returnFlag)
{
    p_powerManger->writeFleetMap(userInfo, mapName,mapInfoIn);
    return 0;
}
int getMapPropertyInfo(soap*,struct UserInfo userInfo,std::string mapName,struct MapPropertyInfo &infoOut)
{
    p_powerManger->getMapPropertyInfo(userInfo, mapName,infoOut);
    return 0;
}
int getVisionTrackConfigList(soap*,struct UserInfo userInfo,std::vector<struct VisionTrackConfig> &configListOut)
{
    p_powerManger->getVisionTrackConfigList(userInfo, configListOut);
    return 0;
}
int getBeltTrackConfigList(soap*,struct UserInfo userInfo,std::vector<struct BeltTrackConfig> &configListOut)
{
    p_powerManger->getBeltTrackConfigList(userInfo, configListOut);
    return 0;
}
int changeVisionTrackConfig(soap*,struct UserInfo userInfo,int id,struct VisionTrackConfig configIn,int &returnFlag)
{
    p_powerManger->changeVisionTrackConfig(userInfo, id,configIn,returnFlag);
    return 0;
}
int changeBeltTrackConfig(soap*,struct UserInfo userInfo,int id,struct BeltTrackConfig configIn,int &returnFlag)
{
    p_powerManger->changeBeltTrackConfig(userInfo, id,configIn,returnFlag);
    return 0;
}

int getEncoderReciverDataList(soap*,struct UserInfo userInfo,std::vector<struct EncoderReceiverData> &dataListReturn)
{
    p_powerManger->getEncoderReciverDataList(userInfo, dataListReturn);
    return 0;
}
int getBeltTrackDebugInfo(soap*,struct UserInfo userInfo,int index,struct BeltTrackDebugInfo &infoOut)
{
    p_powerManger->getBeltTrackDebugInfo(userInfo, index,infoOut);
    return 0;
}
int getVisionTrackDebugInfo(soap*,struct UserInfo userInfo,int index,struct VisionTrackDebugInfo &infoOut)
{
    p_powerManger->getVisionTrackDebugInfo(userInfo, index,infoOut);
    return 0;
}

int getSocketFleetCommandLog(soap*,struct UserInfo userInfo,FleetCommandDebugInfo &fleetCommandLogOut)
{
    std::queue<std::string> tmpInfo;
    p_powerManger->getSocketFleetCommandLog(tmpInfo);
    int tmpSize=tmpInfo.size();
    for(int i=0;i<tmpSize;i++)
    {
        fleetCommandLogOut.fleetCommandLog.push_back(tmpInfo.front());
        tmpInfo.pop();
    }
    return 0;
}

int getModbusFleetCommandLog(soap*,struct UserInfo userInfo,FleetCommandDebugInfo &fleetCommandLogOut)
{
    std::queue<std::string> tmpInfo;
    p_powerManger->getModbusFleetCommandLog(tmpInfo);
    int tmpSize=tmpInfo.size();
    for(int i=0;i<tmpSize;i++)
    {
        fleetCommandLogOut.fleetCommandLog.push_back(tmpInfo.front());
        tmpInfo.pop();
    }
    return 0;
}

//焊接属性
int getWeldPropertConfigList(soap*,struct UserInfo userInfo, std::vector<struct WeldProperty> &configListOut){
    p_powerManger->getWeldPropertyConfigList(userInfo,configListOut);
    return 0;
}
int changeWeldPropertConfigList(soap*,struct UserInfo userInfo, struct WeldProperty configIn,int &returnFlag){
    p_powerManger->changeWeldPropertyConfigList(userInfo,configIn);
    return 0;
}

//焊接条件
int getWeldConditionConfigList(soap*,struct UserInfo userInfo, std::vector<struct WeldCondition> &configListOut){
    p_powerManger->getWeldConditionConfigList(userInfo,configListOut);
    return 0;
}

int changeWeldConditionConfigList(soap*,struct UserInfo userInfo, struct WeldCondition configIn,int &returnFlag){
    p_powerManger->changeWeldConditionConfigList(userInfo,configIn);
    return 0;
}

//弧焊系统配置
int getWeldSystemInfo(soap*,struct UserInfo userInfo, struct WeldSystemInfo &weldSystemInfo){
    p_powerManger->getWeldSystemInfo(userInfo,weldSystemInfo);
    return 0;
}
int changeWeldSystemInfo(soap*,struct UserInfo userInfo, struct WeldSystemInfo configIn,int &returnFlag){
    p_powerManger->changeWeldSystemInfo(userInfo,configIn);
    return 0;
}


int getLaserCameraConfigParameter(soap*,struct UserInfo userInfo, struct LaserCameraConfigParameter &infoOut)
{
    p_powerManger->getLaserCameraConfigParameter(userInfo,infoOut);
    return 0;
}

int getLaserCameraStatus(soap*,struct UserInfo userInfo, struct LaserCameraStatusInfo &infoOut)
{
    p_powerManger->getLaserCameraStatus(userInfo,infoOut);
    return 0;
}
int setLaserCameraConfigParameter(soap*,struct UserInfo userInfo, struct LaserCameraConfigParameter parameter,
                                  int &returnFlag)
{
    p_powerManger->setLaserCameraConfigParameter(userInfo,parameter,returnFlag);
    return 0;
}
int reconnectLaserCamera(soap*,struct UserInfo userInfo, int &returnFlag)
{
    p_powerManger->reconnectLaserCamera(userInfo,returnFlag);
    return 0;
}
int setLaserCameraWork(soap*,struct UserInfo userInfo,bool isWork, int &returnFlag)
{
    p_powerManger->setLaserCameraWork(userInfo,isWork,returnFlag);
    return 0;
}
int setLaserCameraJobId(soap*,struct UserInfo userInfo,int jobIdIn, int &returnFlag)
{
    p_powerManger->setLaserCameraJobId(userInfo,jobIdIn,returnFlag);
    return 0;
}

int calculateLaserCameraFrame(soap*,struct UserInfo userInfo,std::vector<struct PointPro> tcpPointList,
              std::vector<struct PointPro> cameraPointList,struct LaserCameraCalibrateResult &resultOut)
{
    p_powerManger->calculateLaserCameraFrame(userInfo,tcpPointList,cameraPointList,resultOut);
    return 0;
}
int getLaserCameraFrameInfo(soap*,struct UserInfo userInfo,struct LaserCameraFrameInfo &infoOut)
{
    p_powerManger->getLaserCameraFrameInfo(userInfo,infoOut);
    return 0;
}


int getAgvBorderInfo(soap*,struct UserInfo userInfo,struct VehicleBorderInfo &infoOut)
{
    p_powerManger->getAgvBorderInfo(userInfo,infoOut);
    return 0;
}
int setAgvBorderRectInfo(soap*,struct UserInfo userInfo,struct BorderRectInfo rectInfoIn,int &returnFlag)
{
    p_powerManger->setAgvBorderRectInfo(userInfo,rectInfoIn,returnFlag);
    return 0;
}

int getVehicleKinematicDimension(soap*,struct UserInfo userInfo,struct VehicleKinematicDimension &infoOut)
{
    p_powerManger->getVehicleKinematicDimension(userInfo,infoOut);
    return 0;
}
int setVehicleKinematicDimension(soap*,struct UserInfo userInfo,struct VehicleKinematicDimension infoIn,
                                 int &returnFlag)
{
    p_powerManger->setVehicleKinematicDimension(userInfo,infoIn,returnFlag);
    return 0;
}

int getLaserScanParameter(soap*,struct UserInfo userInfo,int laserId,struct LaserScanParameterHmi &infoOut)
{
    p_powerManger->getLaserScanParameter(userInfo,laserId,infoOut);
    return 0;
}
int setLaserScanParameter(soap*,struct UserInfo userInfo,int laserId,struct LaserScanParameterHmi infoIn,
                          int &returnFlag)
{
    p_powerManger->setLaserScanParameter(userInfo,laserId,infoIn,returnFlag);
    return 0;
}

int getVehicleJogControlParameter(soap*,struct UserInfo userInfo,struct VehicleJogControlParameter &infoOut)
{
    p_powerManger->getVehicleJogControlParameter(userInfo,infoOut);
    return 0;
}
int setVehicleJogControlParameter(soap*,struct UserInfo userInfo,struct VehicleJogControlParameter infoIn,
                                  int &returnFlag)
{
    p_powerManger->setVehicleJogControlParameter(userInfo,infoIn,returnFlag);
    return 0;
}

int getVehicleTrajectoryControlParameter(soap*,struct UserInfo userInfo,
                                         struct VehicleTrajectoryControlParameter &infoOut)
{
    p_powerManger->getVehicleTrajectoryControlParameter(userInfo,infoOut);
    return 0;
}
int setVehicleTrajectoryControlParameter(soap*,struct UserInfo userInfo,
                                         struct VehicleTrajectoryControlParameter infoIn,int &returnFlag)
{
    p_powerManger->setVehicleTrajectoryControlParameter(userInfo,infoIn,returnFlag);
    return 0;
}

int getAgvSheftInfo(soap*,struct UserInfo userInfo,int sheftIndex,struct BorderRectInfo &infoOut)
{
    p_powerManger->getAgvSheftInfo(userInfo,sheftIndex,infoOut);
    return 0;
}
int setAgvSheftRectInfo(soap*,struct UserInfo userInfo,int sheftIndex,struct BorderRectInfo rectInfoIn,int &returnFlag)
{
    p_powerManger->setAgvSheftRectInfo(userInfo,sheftIndex,rectInfoIn,returnFlag);
    return 0;
}

int getVehiclePositionCalibrateInfo(soap*,struct UserInfo userInfo,struct VehiclePosition &infoOut)
{
    p_powerManger->getVehiclePositionCalibrateInfo(userInfo,infoOut);
    return 0;
}

int setWeldVirtualMode(soap*,struct UserInfo userInfo,bool isVirtualControlIn,int &returnFlag)
{
    p_powerManger->setWeldVirtualMode(userInfo,isVirtualControlIn,returnFlag);
    return 0;
}
int getWeldIsVirtualStatus(soap*,struct UserInfo userInfo,int &returnFlag)
{
    p_powerManger->getWeldIsVirtualStatus(userInfo,returnFlag);
    return 0;
}

int getImageStringFormImagePath(soap*,struct UserInfo userInfo,std::string imagePathIn,std::string &imageStrOut)
{
    p_powerManger->getImageStringFormImagePath(userInfo,imagePathIn,imageStrOut);
    return 0;
}

int setCoupleControlEnable(soap*,struct UserInfo userInfo,int followAxisId,bool isEnableIn,int &returnFlag)
{
    p_powerManger->setCoupleControlEnable(userInfo,followAxisId,isEnableIn,returnFlag);
    return 0;
}

int setAxisProperty(soap*,struct UserInfo userInfo,int axisId, struct AxisProperty_hmi axisPropertyIn,int &returnFlag)
{
    p_powerManger->setAxisProperty(userInfo,axisId,axisPropertyIn,returnFlag);
    return 0;
}

int getAxisProperty(soap*,struct UserInfo userInfo,int axisId, struct AxisProperty_hmi &axisPropertyOut)
{
    p_powerManger->getAxisProperty(userInfo,axisId,axisPropertyOut);
    return 0;
}

int getCoupleControlInfo(soap*,struct UserInfo userInfo, std::vector<struct CoupleConfigParameter> &infoOut)
{
    p_powerManger->getCoupleControlInfo(userInfo,infoOut);
    return 0;
}

int clearMotorBatteryErrorByAxis(soap*,struct UserInfo userInfo,int axisIdIn,int &returnFlag)
{
    p_powerManger->clearMotorBatteryErrorByAxis(userInfo,axisIdIn,returnFlag);
    return 0;
}

int setCoupleRelativeDistanceMonitorEnable(soap*,struct UserInfo userInfo,int followAxisId,bool isEnableIn,int &returnFlag)
{
    p_powerManger->setCoupleRelativeDistanceMonitorEnable(userInfo,followAxisId,isEnableIn,returnFlag);
    return 0;
}

int forceTrigCamera(soap*,struct UserInfo userInfo,int visionIndexIn,int isHightIn,int &returnFlag)
{
    p_powerManger->forceTrigCamera(userInfo,visionIndexIn,isHightIn,returnFlag);
    return 0;
}

int getEncoderValue_vision(soap*,struct UserInfo userInfo,int visionIndexIn,int &encoderValueOut)
{

        p_powerManger->getEncoderValue_vision(userInfo,visionIndexIn,encoderValueOut);
        return 0;

}

int getEncoderValue_belt(soap*,struct UserInfo userInfo,int beltIndexIn,int &encoderValueOut)
{
    p_powerManger->getEncoderValue_belt(userInfo,beltIndexIn,encoderValueOut);
    return 0;

}


int getRollerMechanismStatus(soap*,struct UserInfo userInfo,enum E_ROLLER_STATUS &statusOut)
{
    p_powerManger->getRollerMechanismStatus(userInfo,statusOut);
    return 0;

}

int setRollerMechanismConfig(soap*,struct UserInfo userInfo,struct RollerMechanismConfig configIn,
                             int &returnFlag)
{
    p_powerManger->setRollerMechanismConfig(userInfo,configIn,returnFlag);
    return 0;

}

int getRollerMechanismConfig(soap*,struct UserInfo userInfo,struct RollerMechanismConfig &configOut)
{
    p_powerManger->getRollerMechanismConfig(userInfo,configOut);
    return 0;

}

int  getLiftMechanismStatus(soap*,struct UserInfo userInfo,enum E_LIFT_STATUS &statusOut)
{
    p_powerManger->getLiftMechanismStatus(userInfo,statusOut);
    return 0;

}

int setLiftMechanismConfig(soap*,struct UserInfo userInfo,struct LiftMechanismConfig configIn,int &returnFlag)
{
    p_powerManger->setLiftMechanismConfig(userInfo,configIn,returnFlag);
    return 0;

}

int getLiftMechanismConfig(soap*,struct UserInfo userInfo,struct LiftMechanismConfig &configOut)
{
    p_powerManger->getLiftMechanismConfig(userInfo,configOut);
    return 0;

}

int setSefetyCheck(soap*,struct UserInfo userInfo,enum E_SAFETY_CHECK typeIn,int isEnable,int &returnFlag)
{
    p_powerManger->setSefetyCheck(userInfo,typeIn,isEnable,returnFlag);
    return 0;
}

int getSefetyCheck(soap*,struct UserInfo userInfo,enum E_SAFETY_CHECK typeIn,int &checkStatusReturn)
{
    p_powerManger->getSefetyCheck(userInfo,typeIn,checkStatusReturn);
    return 0;
}

int setCurrentVehicleBorderId(soap*,struct UserInfo userInfo,int idIn,int &returnFlag)
{
    p_powerManger->setCurrentVehicleBorderId(userInfo,idIn,returnFlag);
    return 0;
}
int getCurrentVehicleBorderId(soap*,struct UserInfo userInfo,int &idOut)
{
    p_powerManger->getCurrentVehicleBorderId(userInfo,idOut);
    return 0;
}

int setAmclPara(soap*,struct UserInfo userInfo,struct AmclDebugPara paraIn,int &returnFlag)
{
    p_powerManger->setAmclPara(userInfo,paraIn,returnFlag);
    return 0;
}

int getAmclPara(soap*,struct UserInfo userInfo,struct AmclDebugPara &paraOut)
{
    p_powerManger->getAmclPara(userInfo,paraOut);
    return 0;
}

int setEthernetIpAddress(soap*,struct UserInfo userInfo,std::string netNameIn,std::string ipIn,int &returnFlag)
{
    p_powerManger->setEthernetIpAddress(userInfo,netNameIn,ipIn,returnFlag);
    return 0;
}
int getVehicleMovingCaligrateInfo(soap*,struct UserInfo userInfo,struct VehicleMovingCaligrateInfo &infoOut)
{
    p_powerManger->getVehicleMovingCaligrateInfo(userInfo,infoOut);
    return 0;
}

int setCalibrateWheelDiameter(soap*,struct UserInfo userInfo,double idealMovedLength,double actualMovedLength,
                              int &returnFlag)
{
    p_powerManger->setCalibrateWheelDiameter(userInfo,idealMovedLength,actualMovedLength,returnFlag);
    return 0;
}
int setCalibrateWheelDistance(soap*,struct UserInfo userInfo,double idealMovedAngle,double actualMovedAngle,
                              int &returnFlag)
{
    p_powerManger->setCalibrateWheelDistance(userInfo,idealMovedAngle,actualMovedAngle,returnFlag);
    return 0;
}

int getControllerAllInformation(soap*,struct UserInfo userInfo,bool isContainIoData,bool isContainAgvData,
                                         bool isContainPointCloud,struct ControllerInformationAll &infoOut)
{
    p_powerManger->getControllerAllInformation(userInfo,isContainIoData,isContainAgvData,isContainPointCloud,infoOut);
    return 0;
}

int getReflectLaserFilterParameter(soap*,struct UserInfo userInfo,int index,struct LaserFilterParameter &paraOut)
{
    p_powerManger->getReflectLaserFilterParameter(userInfo,index,paraOut);
    return 0;
}
int setReflectLaserFilterParameter(soap*,struct UserInfo userInfo,int index,struct LaserFilterParameter  paraIn,
                                   int &returnFlag)
{
    p_powerManger->setReflectLaserFilterParameter(userInfo,index,paraIn,returnFlag);
    return 0;
}

int getReflectCalculateCommonParameter(soap*,struct UserInfo userInfo,struct ReflectCommonDetectPara &paraOut)
{
    p_powerManger->getReflectCalculateCommonParameter(userInfo,paraOut);
    return 0;
}
int setReflectCalculateCommonParameter(soap*,struct UserInfo userInfo,struct ReflectCommonDetectPara paraIn,int &returnFlag)
{
    p_powerManger->setReflectCalculateCommonParameter(userInfo,paraIn,returnFlag);
    return 0;
}

int getAmclDebugInfo(soap*,struct UserInfo userInfo,struct AmclDebugInfo &debugInfoOut)
{
    p_powerManger->getAmclDebugInfo(userInfo,debugInfoOut);
    return 0;
}

int getBatteryPeakConfig(soap*,struct UserInfo userInfo,struct BatteryPeakConfig &configOut)
{
    p_powerManger->getBatteryPeakConfig(userInfo,configOut);
    return 0;
}
int setBatteryPeakConfig(soap*,struct UserInfo userInfo,struct BatteryPeakConfig configIn,int &returnFlag)
{
    p_powerManger->setBatteryPeakConfig(userInfo,configIn,returnFlag);
    return 0;
}

int forceConnectCamera(soap*,struct UserInfo userInfo,int visionIndex,int &returnFlag)
{
    p_powerManger->forceConnectCamera(userInfo,visionIndex,returnFlag);
    return 0;
}

int getRobotCoordinateConfig(soap*,struct UserInfo userInfo,struct RobotCoordinateAxisConfig &configOut)
{
    p_powerManger->getRobotCoordinateConfig(userInfo,configOut);
    return 0;
}

int setRobotCoordinateConfig(soap*,struct UserInfo userInfo,struct RobotCoordinateAxisConfig configIn,int &returnFlag)
{
    p_powerManger->setRobotCoordinateConfig(userInfo,configIn,returnFlag);
    return 0;
}

int setDragControl(soap*,struct UserInfo userInfo,bool isOn,int &returnFlag)
{
    p_powerManger->setDragControl(userInfo,isOn,returnFlag);
    return 0;
}

int setGravityVector(soap*,struct UserInfo userInfo,std::vector<double> gravityIn,int &returnFlag)
{
    p_powerManger->setGravityVector(userInfo,gravityIn,returnFlag);
    return 0;
}
int setToolMass(soap*,struct UserInfo userInfo,int toolIndex, double mass, std::vector<double> center,
                int &returnFlag)
{
    p_powerManger->setToolMass(userInfo,toolIndex,mass,center,returnFlag);
    return 0;
}

int getWeldDebugStatusInfo(soap*,struct UserInfo userInfo,struct WeldCraftStatusInfo& infoOut)
{
    p_powerManger->getWeldDebugStatusInfo(userInfo,infoOut);
    return 0;
}
int weldDebugOperation(soap*,struct UserInfo userInfo,enum E_WELD_TEST typeIn,bool control,int &returnFlag)
{
    p_powerManger->weldDebugOperation(userInfo,typeIn,control,returnFlag);
    return 0;
}
int setWeldCollisionCheck(soap*,struct UserInfo userInfo,bool isCheck,int &returnFlag)
{
    p_powerManger->setWeldCollisionCheck(userInfo,isCheck,returnFlag);
    return 0;
}

int getWeaveMotionConditionInfo(soap*,struct UserInfo userInfo,
                                std::vector<struct WeaveMotionCondition> &infoOut)
{
    p_powerManger->getWeaveMotionConditionInfo(userInfo,infoOut);
    return 0;
}
int setWeaveMotionConditionInfo(soap*,struct UserInfo userInfo,struct WeaveMotionCondition infoIn,
                                int &returnFlag)
{
    p_powerManger->setWeaveMotionConditionInfo(userInfo,infoIn,returnFlag);
    return 0;
}

int getPalletConditionInfo(soap*,struct UserInfo userInfo,std::vector<struct PalletMiddleInfo> &infoOut)
{
    p_powerManger->getPalletConditionInfo(userInfo,infoOut);
    return 0;
}

int setPalletConditionInfo(soap*,struct UserInfo userInfo,struct StackInfo infoIn,int &returnFlag)
{
    p_powerManger->setPalletConditionInfo(userInfo,infoIn,returnFlag);
    return 0;
}

int addProgramMoveCommand_hmi(soap*,struct UserInfo userInfo,vector<MoveParameter> tmpCommandVectorIn,int &returnFlag)
{
    p_powerManger->addProgramMoveCommand_hmi(userInfo,tmpCommandVectorIn,returnFlag);
    return 0;
}

int addCircle(soap*,struct UserInfo userInfo,int idIn, std::vector<double> posIn, std::vector<double> centerIn,
              std::vector<double> normalIn, double vel, int turnsIn, int velTypeIn,int &returnFlag)
{
    p_powerManger->addCircle(userInfo,idIn,posIn,centerIn,normalIn,vel,turnsIn,velTypeIn,returnFlag);
    return 0;
}

int getLaserCameraBufferMoveConfigParameter(soap*,struct UserInfo userInfo,struct BufferMoveConfig &paraOut)
{
    p_powerManger->getLaserCameraBufferMoveConfigParameter(userInfo,paraOut);
    return 0;
}
int setLaserCameraBufferMoveConfigParameter(soap*,struct UserInfo userInfo,struct BufferMoveConfig paraIn,int &returnFlag)
{
    p_powerManger->setLaserCameraBufferMoveConfigParameter(userInfo,paraIn,returnFlag);
    return 0;
}
int getLaserTrackConfigParameter(soap*,struct UserInfo userInfo,struct LaserTrackConfig &paraOut)
{
    p_powerManger->getLaserTrackConfigParameter(userInfo,paraOut);
    return 0;
}
int setLaserTrackConfigParameter(soap*,struct UserInfo userInfo,struct LaserTrackConfig paraIn,int &returnFlag)
{
    p_powerManger->setLaserTrackConfigParameter(userInfo,paraIn,returnFlag);
    return 0;
}

int changeCurrentRobotId(soap*,struct UserInfo userInfo, int robotIdIn, int &returnFlag)
{
    p_powerManger->changeCurrentRobotId(userInfo,robotIdIn,returnFlag);
    return 0;
}
